package com.an.demo.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * 测试演示
 *
 * @author: Ann
 * @createDate: 2023/12/08 10:11:30
 * @version: 1.0.0
 */
public class TestDemo {


/*
    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1, 2, 5, 9, 4);
        System.out.println(list);
    }
*/

    /**
     * 删除重复
     *
     * @param integerList 整数列表
     * @return {@link List }<{@link Integer }>
     * @author: Ann
     * @createDate: 2023/12/13 10:48:52
     * @version: 1.0.0
     */
    private static List<Integer> removeDuplicates(List<Integer> integerList) {
        List<Integer> newIntList = new ArrayList<>();
        for (Integer i : integerList) {
            if (!newIntList.contains(i)) {
                newIntList.add(i);
            }
        }
        return newIntList;

    }

    /**
     * 排序列表
     *
     * @param integerList 整数列表
     * @author: Ann
     * @createDate: 2023/12/13 10:46:36
     * @version: 1.0.0
     */
    private static void sortList(List<Integer> integerList) {
        for (int i = 0; i < integerList.size(); i++) {
            for (int j = 0; j < integerList.size() - 1 - i; j++) {
                if (integerList.get(j) > integerList.get(j + 1)) {
                    int temp = integerList.get(j);
                    integerList.set(j, j + 1);
                    integerList.set(j + 1, temp);
                }
            }
        }
    }


}

